<!--style-->
<style>
    #block-calendar .banner .more {
        overflow: visible;
        margin: -1px 8px 0 0;
        padding: 0;
    }

    #btn-sign-calendar {
        display: inline-block;
        *display: inline;
        float: none;
    }

    #item-date-calendar {
        display: inline-block;
        *display: inline;
        font-size: 32px;
        font-weight: bold;
        font-family: Michroma, 'Segoe UI Light', 'Segoe UI', 'Segoe UI WP', 'Microsoft Jhenghei', '微软雅黑', sans-serif, Times;
        line-height: 1.5;
        letter-spacing: -0.1em;
        text-align: left;
        color: #333;
    }

    #item-subdate-calendar {
        font-size: 14px;
        font-family: Michroma, 'Segoe UI Light', 'Segoe UI', 'Segoe UI WP', 'Microsoft Jhenghei', '微软雅黑', sans-serif, Times;
        font-style: italic;
        line-height: 1.2;
        letter-spacing: -0.1em;
        text-align: left;
        color: #666;
        margin: 0 0 8px 0;
    }

    #table {
        font-family: "Consolas", "Microsoft Yahei", Arial, sans-serif;
        position: relative;
        width: 100%;
    }

    #table tr {
        position: relative;
    }

    #good {
        background-color: #ffa;
    }

    #bad {
        background-color: #ffddd3;
    }

    #table .left {
        background-color: #fe4;
        color: #222;
        font-size: 48px;
        font-weight: bold;
        line-height: normal;
        width: 30%;
        height: 100%;
        text-align: center;
        vertical-align: middle;
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
    }

    #bad .left {
        background-color: #f44;
        color: #fff;
    }

    #table .right {
        width: 70%;
        vertical-align: middle;
    }

    #table .a {
        display: block;
        color: #444;
        font-size: 24px;
        font-weight: bold;
        width: auto;
        height: auto;
        line-height: 1.2;
        margin: 8px 16px 0;
        padding: 0;
    }

    #table .b {
        display: block;
        color: #777;
        font-size: 14px;
        font-style: italic;
        width: auto;
        height: auto;
        line-height: 1.2;
        margin: 4px 16px 8px;
        padding: 0;
    }

    #table .c {
        max-width: 56px;
        max-height: 56px;
        *width: auto;
        *height: auto;
        display: block;
        margin: 0 8px 8px 16px;
        float: left;
    }

    #item-sign-calendar {
        font-family: "Consolas", "Microsoft Yahei", Arial, sans-serif;
        font-size: 48px;
        font-weight: bold;
        line-height: normal;
        width: auto;
        height: auto;
        text-align: right;
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
        cursor: default;
        user-select: none;
        letter-spacing: -0.1em;
    }
</style>
<!--style-->

<!--html-->
<div id="area-top-calendar">
    <div class="l">
        <p id="item-date-calendar"></p>

        <p id="item-subdate-calendar"></p>
    </div>
    <div class="r">
        <p id="item-sign-calendar"></p>
    </div>
    <span class="clearfix"></span>
</div>
<!--
<table id="table">
    <tbody valign="middle">
    <tr id="good">
        <td class="left">宜</td>
        <td class="right">
            <ul></ul>
        </td>
    </tr>
    <tr id="bad">
        <td class="left">忌</td>
        <td class="right">
            <ul></ul>
        </td>
    </tr>
    </tbody>
</table>
-->
<!--html-->

<!--script-->
<script>
system.tv = function () {
    //set handle
    var block = $('#block-calendar');
    var mainer = block.find('div.mainer').eq(0);
    var d = new Date();
    var seed = d.getFullYear() * 37621 + (d.getMonth() + 1) * 539 + d.getDate();
    //
    var list = [
        {name: "看AV", good: "释放压力，重铸自我", bad: "会被家人撞到"},
        {name: "组模型", good: "今天的喷漆会很完美", bad: "精神不集中板件被剪断了"},
        {name: "投稿情感区", good: "问题圆满解决", bad: "会被当事人发现"},
        {name: "逛匿名版", good: "今天也要兵库北", bad: "看到丧尸在晒妹"},
        {name: "和女神聊天", good: "女神好感度上升", bad: "我去洗澡了，呵呵"},
        {name: "啪啪啪", good: "啪啪啪啪啪啪啪", bad: "会卡在里面"},
        {name: "熬夜", good: "夜间的效率更高", bad: "明天有很重要的事"},
        {name: "锻炼", good: "八分钟给你比利般的身材", bad: "会拉伤肌肉"},
        {name: "散步", good: "遇到妹子主动搭讪", bad: "走路会踩到水坑"},
        {name: "打排位赛", good: "遇到大腿上分500", bad: "我方三人挂机"},
        {name: "汇报工作", good: "被夸奖工作认真", bad: "上班偷玩游戏被扣工资"},
        {name: "抚摸猫咪", good: "才不是特意蹭你的呢", bad: "死开！愚蠢的人类"},
        {name: "遛狗", good: "遇见女神遛狗搭讪", bad: "狗狗随地大小便被罚款"},
        {name: "烹饪", good: "黑暗料理界就由我来打败", bad: "难道这就是……仰望星空派？"},
        {name: "告白", good: "其实我也喜欢你好久了", bad: "对不起，你是一个好人"},
        {name: "求站内信", good: "最新种子入手", bad: "收到有码葫芦娃"},
        {name: "追新番", good: "完结之前我绝不会死", bad: "会被剧透"},
        {name: "打卡日常", good: "怒回首页", bad: "会被老板发现"},
        {name: "下副本", good: "配合默契一次通过", bad: "会被灭到散团"},
        {name: "抢沙发", good: "沙发入手弹无虚发", bad: "会被挂起来羞耻play"},
        {name: "网购", good: "商品大减价", bad: "问题产品需要退换"},
        {name: "跳槽", good: "新工作待遇大幅提升", bad: "再忍一忍就加薪了"},
        {name: "读书", good: "知识就是力量", bad: "注意力完全无法集中"},
        {name: "早睡", good: "早睡早起方能养生", bad: "会在半夜醒来，然后失眠"},
        {name: "逛街", good: "物美价廉大优惠", bad: "会遇到奸商"}
    ];
    var avatars = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50];
    //function
    //calendar
    var CalendarData = new Array(100);
    var madd = new Array(12);
    var tgString = "甲乙丙丁戊己庚辛壬癸";
    var dzString = "子丑寅卯辰巳午未申酉戌亥";
    var numString = "一二三四五六七八九十";
    var monString = "正二三四五六七八九十冬腊";
    var weekString = "日一二三四五六";
    var sx = "鼠牛虎兔龙蛇马羊猴鸡狗猪";
    var cYear,
            cMonth,
            cDay,
            TheDate;
    CalendarData = new Array(0xA4B, 0x5164B, 0x6A5, 0x6D4, 0x415B5, 0x2B6, 0x957, 0x2092F, 0x497, 0x60C96, 0xD4A, 0xEA5, 0x50DA9, 0x5AD, 0x2B6, 0x3126E, 0x92E, 0x7192D, 0xC95, 0xD4A, 0x61B4A, 0xB55, 0x56A, 0x4155B, 0x25D, 0x92D, 0x2192B, 0xA95, 0x71695, 0x6CA, 0xB55, 0x50AB5, 0x4DA, 0xA5B, 0x30A57, 0x52B, 0x8152A, 0xE95, 0x6AA, 0x615AA, 0xAB5, 0x4B6, 0x414AE, 0xA57, 0x526, 0x31D26, 0xD95, 0x70B55, 0x56A, 0x96D, 0x5095D, 0x4AD, 0xA4D, 0x41A4D, 0xD25, 0x81AA5, 0xB54, 0xB6A, 0x612DA, 0x95B, 0x49B, 0x41497, 0xA4B, 0xA164B, 0x6A5, 0x6D4, 0x615B4, 0xAB6, 0x957, 0x5092F, 0x497, 0x64B, 0x30D4A, 0xEA5, 0x80D65, 0x5AC, 0xAB6, 0x5126D, 0x92E, 0xC96, 0x41A95, 0xD4A, 0xDA5, 0x20B55, 0x56A, 0x7155B, 0x25D, 0x92D, 0x5192B, 0xA95, 0xB4A, 0x416AA, 0xAD5, 0x90AB5, 0x4BA, 0xA5B, 0x60A57, 0x52B, 0xA93, 0x40E95);
    madd[0] = 0;
    madd[1] = 31;
    madd[2] = 59;
    madd[3] = 90;
    madd[4] = 120;
    madd[5] = 151;
    madd[6] = 181;
    madd[7] = 212;
    madd[8] = 243;
    madd[9] = 273;
    madd[10] = 304;
    madd[11] = 334;
    function GetBit(m, n) {
        return (m >> n) & 1;
    };
    function e2c() {
        TheDate = (arguments.length != 3) ? new Date() : new Date(arguments[0], arguments[1], arguments[2]);
        var total,
                m,
                n,
                k;
        var isEnd = false;
        var tmp = TheDate.getYear();
        if (tmp < 1900) {
            tmp += 1900;
        }
        ;
        total = (tmp - 1921) * 365 + Math.floor((tmp - 1921) / 4) + madd[TheDate.getMonth()] + TheDate.getDate() - 38;
        if (TheDate.getYear() % 4 == 0 && TheDate.getMonth() > 1) {
            total++;
        }
        ;
        for (m = 0; m < 255; m++) {
            k = (CalendarData[m] < 0xfff) ? 11 : 12;
            for (n = k; n >= 0; n--) {
                if (total <= 29 + GetBit(CalendarData[m], n)) {
                    isEnd = true;
                    break;
                }
                ;
                total = total - 29 - GetBit(CalendarData[m], n);
            }
            ;
            if (isEnd) {
                break;
            }
            ;
        }
        ;
        cYear = 1921 + m;
        cMonth = k - n + 1;
        cDay = total;
        if (k == 12) {
            if (cMonth == Math.floor(CalendarData[m] / 0x10000) + 1) {
                cMonth = 1 - cMonth;
            }
            ;
            if (cMonth > Math.floor(CalendarData[m] / 0x10000) + 1) {
                cMonth--;
            }
            ;
        }
        ;
    };
    function GetcDateString() {
        var tmp = "";
        tmp += tgString.charAt((cYear - 4) % 10);
        tmp += dzString.charAt((cYear - 4) % 12);
        tmp += "";
        tmp += sx.charAt((cYear - 4) % 12);
        tmp += "年 ";
        if (cMonth < 1) {
            tmp += "闰";
            tmp += monString.charAt(-cMonth - 1);
        } else {
            tmp += monString.charAt(cMonth - 1);
        }
        ;
        tmp += "月";
        tmp += (cDay < 11) ? "初" : ((cDay < 20) ? "十" : ((cDay < 30) ? "廿" : "三十"));
        if (cDay % 10 != 0 || cDay == 10) {
            tmp += numString.charAt((cDay - 1) % 10);
        }
        ;
        return tmp;
    };
    function GetLunarDay(solarYear, solarMonth, solarDay) {
        //solarYear = solarYear<1900?(1900+solarYear):solarYear;
        if (solarYear < 1921 || solarYear > 2020) {
            return "";
        } else {
            solarMonth = (parseInt(solarMonth) > 0) ? (solarMonth - 1) : 11;
            e2c(solarYear, solarMonth, solarDay);
            return GetcDateString();
        }
        ;
    };
    var GetDay = function () {
        return d.getFullYear() + '年' + (1 + d.getMonth()) + '月' + d.getDate() + '日 星期' + ['日', '一', '二', '三', '四', '五', '六'][d.getDay()];
    };
    //
    var rnd = function (a, b) {
        var n = a % 11117;
        for (var i = 0; i < 25 + b; i++) {
            n = n * n;
            n = n % 11117;
        }
        ;
        return n;
    };
    //
    $('#item-date-calendar')
            .text(GetDay());
    $('#item-subdate-calendar')
            .text(GetLunarDay(d.getFullYear(), (1 + d.getMonth()), d.getDate()));
    //size
    var sg = rnd(seed, 8) % 100;
    var sb = rnd(seed, 4) % 100;
    //insert html
    var html = '';
    for (var i = 0, l = rnd(seed, 9) % 3 + 2; i < l; i++) {
        var n = parseInt(sg * 0.01 * list.length, 10);
        var a = list[n];
        var m = parseInt(rnd(seed, (3 + i)) % 100 * 0.01 * avatars.length, 10);
        html += '<li><img class="c" src="' + system.path + '/ueditor/dialogs/emotion/images/ac/' + avatars[m] + '.gif"><p class="a">' + a.name + '</p><p class="b">' + a.good + '</p><span class="clearfix"></span></li>';
        //
        list.splice(n, 1);
        avatars.splice(m, 1);
    }
    ;
    //$('#good').find('ul').eq(0)
    //        .html(html);
    html = '';
    for (var i = 0, l = rnd(seed, 7) % 3 + 2; i < l; i++) {
        var n = parseInt(sb * 0.01 * list.length, 10);
        var a = list[n];
        var m = parseInt(rnd(seed, (2 + i)) % 100 * 0.01 * avatars.length, 10);
        html += '<li><img class="c" src="' + system.path + '/ueditor/dialogs/emotion/images/ac/' + avatars[m] + '.gif"><p class="a">' + a.name + '</p><p class="b">' + a.bad + '</p><span class="clearfix"></span></li>';
        //
        list.splice(n, 1);
        avatars.splice(m, 1);
    }
    ;
    //$('#bad').find('ul').eq(0)
    //        .html(html);
    //lucky
    var f = function () {
        //
        var n = rnd(seed * user.uid, 6) % 100;
        var t = '末吉';
        //if
        if (n < 5) {
            //5%
            t = '大凶';
        } else if (n < 20) {
            //15%
            t = '凶';
        } else if (n < 50) {
            //30%
            t = '末吉';
        } else if (n < 60) {
            //10%
            t = '半吉';
        } else if (n < 70) {
            //10%
            t = '吉';
        } else if (n < 80) {
            //10%
            t = '小吉';
        } else if (n < 90) {
            //10%
            t = '中吉';
        } else {
            //5%
            t = '大吉';
        }
        ;
        /*$('#item-sign-calendar')
                .text(t)
                .css({
                    color: 'rgb(' + (10 + n * 0.8) + '%, 20%, 20%)'
                })
                .attr({
                    title: '今日运势指数：' + n + '%'
                })*/
    }();
}();
</script>
<!--script-->